﻿using System;

namespace Jacobi.Seesmic.FeedReader.Utilities
{
    /// <summary>
    /// Helper class for method parameter validation.
    /// </summary>
    internal static class Guard
    {
        /// <summary>
        /// Extension method for checking if an argument is null.
        /// </summary>
        /// <param name="argument">Can be null.</param>
        /// <param name="argumentName">The name of the argument in the calling code.</param>
        public static void ThrowIfArgumentIsNull(this object argument, string argumentName)
        {
            if (argument == null)
            {
                throw new ArgumentNullException(argumentName);
            }
        }
    }
}